clear;
%parameters
timeLag = 2;
nGames = 1000;         %number of games to be played
ship = 1;           % 1=shipSimple, 2=shipMarkov, 3=shipSin, 4=shipCurve
bomber = 1;         % 1=bomberu, 2=bomberw
bombRadius = 5;

%store every single outcome, so we can perfrom statistics on it later
hit = zeros(nGames,1);          %hit(i) is true if the bomber hit the ship in the ith game
turn = zeros(nGames,1);         %turn(i) is the number of turns it took until game i was finished

%play the games
for i=1:nGames
    [h,t,shipPos,dropPos] = game(timeLag,ship, bomber, bombRadius);
    hit(i) = h;
    turn(i) = t;
end

%do some statistics on the obtained data
%TODO: determine confidence interval for the hit-rate
hitMean = mean(hit)
hitStandardDeviation = std(hit)
turnMean = mean(turn)
turnStandardDeviation = std(turn)
[muhat, sighat, muci, sigci] = normfit(hit,0.05)

plot(shipPos(:,1),shipPos(:,2), dropPos(1), dropPos(2), 'x'); %plot the path of the ship
